#ifndef LEXICALANALYZER_H
#define LEXICALANALYZER_H

#include <iostream>
#include <string>

using namespace std;

/*
class LexAnalyzer
{

public:
        LexAnalyzer();
        bool is_keyword( string checkString );

private:
        string keywords[13];
        string operators[11];
        string seperators[11];
        int FSM_identifiers[5][3];
        int FSM_integers_and_reals[5][3];
        char** Tokens;
        char** Lexemes;

};
*/

struct results
{
        string lexeme;
        string token;
        unsigned int index;
};

string keywords[13]= { "function", "int", "boolean", "real", "if", "endif", "else", "return", "print", "scan", "while", "true", "false"};
string operators[11] = {"+", "-", "<=", ":=", "=", "/=", ">", "<", "=>", "*", "/"};
string seperators[11] = {"#", "(", ")", ",", ":", "{", "}", ".", "[", "]", ";"};

//NOT correct right now
int FSM_identifiers[5][3]={    {1, -1, -1},
                               {2, 3, 7},
                               {5, 6, 7},
                               {5, 6, 7},
                               {5, 6, 7}       };
//NOT correct right now
int FSM_integers_and_reals[5][3]={      {1, -1, -1},
										{2, 3, 7},
										{5, 6, 7},
										{5, 6, 7},
										{5, 6, 7}       };



//is_keyword:
//checks if the string passed in is contained in the keywords array
bool is_keyword( string checkString )
{ 
        for( int i = 0; i < 12; i++ )
        {
                if( checkString == keywords[i] )
                {
                        return true;
                }
        }

        return false;
}

//is_operator:
//checks if the string passed in is contained in the operators array
bool is_operator( string checkString )
{ 
        for( int i = 0; i < 10; i++ )
        {
                if( checkString == operators[i] )
                {
                        return true;
                }
        }

        return false;
}

//is_seperator:
//checks if the string passed in is contained in the seperators array
bool is_seperator( string checkString )
{ 
        for( int i = 0; i < 10; i++ )
        {
                if( checkString == seperators[i] )
                {
                        return true;
                }
        }

        return false;
}

//is_identifier:
bool is_identifier( string checkString )
{ 
		//go through the FSM FSM_identifiers
		//if in accepting state, return true.
        return false;
}


//is_int_or_real:
bool is_int_or_real( string checkString )
{ 
		//go through the FSM FSM_integers_and_reals
		//if in accepting state, return true.
        return false;
}

#endif